home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nebula 2
/
Nebula Two.iso
/
SourceCode
/
GameKit
/
Apps
/
HighScoreEditor
/
HighScoreEditor.m
< prev
next >
Wrap
Text File
|
1995-06-12
|
1KB
|
59 lines
#import "HighScoreEditor.h"
#import "EditingHSController.h"
@implementation HighScoreEditor
- init
{
connected = NO;
return self;
}
- connectToggle:sender
{
if (connected) [self disconnect:sender];
else [self connect:sender];
return self;
}
- disconnect:sender
{
[highScoreController setLocalScores:YES];
connected = NO;
[connectWindow setTitle:[stringTable
valueForStringKey:"DisconnectedTitle"]];
[connectButton setTitle:[stringTable valueForStringKey:"Connect"]];
return self;
}
- connect:sender
{
[highScoreController setServerHost:[serverNameText stringValue]];
[highScoreController setGameName:[gameNameText stringValue]];
[highScoreController setLocalScores:NO];
[highScoreController readHighScores];
[highScoreController displayHighScores:self];
connected = ![highScoreController localScores];
if (!connected) return self;
[connectWindow setTitle:[stringTable
valueForStringKey:"ConnectedTitle"]];
[connectButton setTitle:[stringTable valueForStringKey:"Disconnect"]];
return self;
}
- appDidInit:sender
{
return self;
}
- appWillTerminate:sender
{
// don't leave open connections hanging around; shut down cleanly.
if (connected) [self disconnect:self];
return self;
}
@end